package service;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import util.mysqlUtil;

public class Assign {
	public static int assignMember(String id,String passwd,String name,String car,String phone,String mail){
		Connection conn = null;
		try {
			conn = mysqlUtil.getConn();
			//id  passwd  name  car  phone  mail  
			PreparedStatement pstmt = conn.prepareStatement("INSERT INTO  member (id,passwd,name,car,phone,mail) VALUES (?,?,?,?,?,?);");
			pstmt.setString(1, id);
			pstmt.setString(2, passwd);
			pstmt.setString(3, name);
			pstmt.setString(4, car);
			pstmt.setString(5, phone);
			pstmt.setString(6, mail);
			pstmt.execute();
		} catch (SQLException e) {
			return 0;
		} finally {
			mysqlUtil.close(conn);
		}
		return 1;
	}
}
